home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / local / bin / tails-virt-notify-user < prev    next >
Encoding:
Text File  |  2012-08-03  |  1.3 KB  |  63 lines

  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. #man{{{
  7.  
  8. =head1 NAME
  9.  
  10. tails-virt-notify-user
  11.  
  12. =head1 VERSION
  13.  
  14. Version X.XX
  15.  
  16. =head1 AUTHOR
  17.  
  18. Tails dev team <amnesia@boum.org>
  19. See https://tails.boum.org/.
  20.  
  21. =cut
  22.  
  23. #}}}
  24.  
  25. use Carp;
  26. use Desktop::Notify;
  27. use Fatal qw( open close );
  28. use Locale::gettext;
  29. use POSIX;
  30.  
  31. ### initialization
  32. setlocale(LC_MESSAGES, "");
  33. textdomain("tails-virt-notify-user");
  34. my $detected_virt_file='/var/lib/live/detected-virtual-machine';
  35.  
  36. ### main
  37.  
  38. exit 0 unless -e $detected_virt_file;
  39.  
  40. my @detected_virt;
  41.  
  42. open my $detected_virt_file_h, '<', $detected_virt_file;
  43. while (my $detected_virt = <$detected_virt_file_h>) {
  44.     chomp $detected_virt;
  45.     push @detected_virt, $detected_virt;
  46. }
  47. close $detected_virt_file_h;
  48.  
  49. exit 0 unless @detected_virt;
  50.  
  51. my $notify = Desktop::Notify->new();
  52.  
  53. my $summary = gettext("Warning: virtual machine detected!");
  54. my $body    =
  55.     gettext("Both the host operating system and the virtualization software are able to monitor what you are doing in Tails.")
  56.     . " "
  57.     . gettext("<a href='file:///usr/share/doc/tails/website/doc/advanced_topics/virtualization.en.html'>Learn more...</a>")
  58.     . " "; # Workaround: else the last line of the notification is not displayed
  59.  
  60. $notify->create(summary => $summary,
  61.                 body => $body,
  62.                 timeout => 0)->show();
  63.